import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class FlashPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _FlashPageState();
  }
}

class _FlashPageState extends State<FlashPage> {
  @override
  Widget build(BuildContext context) {
    // TODO: // 加载闪屏界面
    return Image.network(
      'https://www.yimizi.xyz/wedding/image/only/10.webp',
      fit: BoxFit.fitHeight,
      // color: Colors.red,
    );
    /*return Image.asset(
      'assets/img/fly_girl.jpeg',
      fit: BoxFit.fitHeight,
    );*/
  }

  @override
  void initState() {
    // TODO: implement initState
    super.initState();

    Future.delayed(Duration(seconds: 4), toMainPage()).whenComplete(() {
//      Navigator.popAndPushNamed(context, '/')
//      Navigator.pop(context, );
      Navigator.pushReplacementNamed(context, 'main');
    });
  }

  toMainPage() {
    print("xxxx------");
  }
}
